def method01():
    # 列表生成式修改为小括号
    generator = (i * i for i in range(20))
    for i in generator:
        print(i)


def method02(start, end):
    while start < end:
        yield start
        start += 1


if __name__ == '__main__':
    method01()
    for i in method02(1,5):
        print(i)
